commonlibsse_ng\re\t\TESForm/
vtable.rs1use super::TESForm;
2use crate::re::BGSLoadFormBuffer::BGSLoadFormBuffer;
3use crate::re::BGSSaveFormBuffer::BGSSaveFormBuffer;
4use crate::re::BSCoreTypes::FormID;
5use crate::re::BSFixedString::BSFixedString;
6use crate::re::FORM::{FORM, FORM_GROUP};
7use crate::re::FormTypes::FormType;
8use crate::re::TESBoundObject::TESBoundObject;
9use crate::re::TESFile::TESFile;
10use crate::re::TESObjectREFR::TESObjectREFR;
11use core::ffi::c_char;
12
13#[repr(C)]
15#[derive(Debug)]
16pub struct TESFormVtbl {
17 pub CxxDrop: fn(this: &mut TESForm),
21
22 pub InitializeDataComponent: fn(this: &mut TESForm),
26
27 pub ClearDataComponent: fn(this: &mut TESForm),
31
32 pub CopyComponent: fn(this: &mut TESForm, rhs: *const TESForm),
35
36 pub InitializeData: fn(this: &mut TESForm),
40
41 pub ClearData: fn(this: &mut TESForm),
45
46 pub Load: fn(this: &mut TESForm, mod_file: *mut TESFile) -> bool,
50
51 pub LoadPartial: fn(this: &mut TESForm, mod_file: *mut TESFile) -> bool,
55
56 pub LoadEdit: fn(this: &mut TESForm, mod_file: *mut TESFile) -> bool,
60
61 pub CreateDuplicateForm:
64 fn(this: &mut TESForm, create_editor_id: bool, arg2: *mut ()) -> *mut TESForm,
65
66 pub AddChange: fn(this: &mut TESForm, change_flags: u32) -> bool,
69
70 pub RemoveChange: fn(this: &mut TESForm, change_flags: u32),
73
74 pub FindInFileFast: fn(this: &mut TESForm, mod_file: *mut TESFile) -> bool,
78
79 pub CheckSaveGame: fn(this: &mut TESForm, buf: *mut BGSSaveFormBuffer) -> bool,
83
84 pub SaveGame: fn(this: &TESForm, buf: *mut BGSSaveFormBuffer),
87
88 pub LoadGame: fn(this: &mut TESForm, buf: *mut BGSLoadFormBuffer),
91
92 pub InitLoadGame: fn(this: &mut TESForm, buf: *mut BGSLoadFormBuffer),
96
97 pub FinishLoadGame: fn(this: &mut TESForm, buf: *mut BGSLoadFormBuffer),
101
102 pub Revert: fn(this: &mut TESForm, buf: *mut BGSLoadFormBuffer),
106
107 pub InitItemImpl: fn(this: &mut TESForm),
111
112 pub GetDescriptionOwnerFile: fn(this: &TESForm) -> *mut TESFile,
115
116 pub GetSavedFormType: fn(this: &TESForm) -> FormType,
120
121 pub GetFormDetailedString: fn(this: &TESForm, buf: *mut c_char, buf_len: u32),
124
125 pub GetKnown: fn(this: &TESForm) -> bool,
129
130 pub GetRandomAnim: fn(this: &TESForm) -> bool,
134
135 pub GetPlayable: fn(this: &TESForm) -> bool,
139
140 pub IsHeadingMarker: fn(this: &TESForm) -> bool,
144
145 pub GetDangerous: fn(this: &TESForm) -> bool,
149
150 pub QHasCurrents: fn(this: &TESForm) -> bool,
154
155 pub GetObstacle: fn(this: &TESForm) -> bool,
159
160 pub QIsLODLandObject: fn(this: &TESForm) -> bool,
164
165 pub GetOnLocalMap: fn(this: &TESForm) -> bool,
169
170 pub GetMustUpdate: fn(this: &TESForm) -> bool,
174
175 pub SetOnLocalMap: fn(this: &mut TESForm, set: bool),
179
180 pub GetIgnoredBySandbox: fn(this: &TESForm) -> bool,
184
185 pub SetDelete: fn(this: &mut TESForm, set: bool),
189
190 pub SetAltered: fn(this: &mut TESForm, set: bool),
193
194 pub SaveObjectBound: fn(this: &mut TESForm),
198
199 pub LoadObjectBound: fn(this: &mut TESForm, mod_: *mut TESFile),
203
204 pub IsBoundObject: fn(this: &TESForm) -> bool,
208
209 pub IsObject: fn(this: &TESForm) -> bool,
213
214 pub IsMagicItem: fn(this: &TESForm) -> bool,
218
219 pub IsWater: fn(this: &TESForm) -> bool,
223
224 pub AsReference1: fn(this: &mut TESForm) -> *mut TESObjectREFR,
228
229 pub AsReference2: fn(this: &TESForm) -> *const TESObjectREFR,
233
234 pub GetRefCount: fn(this: &TESForm) -> u32,
238
239 pub GetTextForParsedSubTag: fn(this: &TESForm, tag: &BSFixedString) -> *const c_char,
242
243 pub Copy: fn(this: &mut TESForm, src_form: *const TESForm),
247
248 pub BelongsInGroup: fn(
251 this: &TESForm,
252 form: *const FORM,
253 allow_parent_groups: bool,
254 current_only: bool,
255 ) -> bool,
256
257 pub CreateGroupData: fn(this: &TESForm, form: *const FORM, group: *mut FORM_GROUP),
260
261 pub GetFormEditorID: fn(this: &TESForm) -> *const c_char,
265
266 pub SetFormEditorID: fn(this: &mut TESForm, str: *const c_char) -> bool,
270
271 pub IsParentForm: fn(this: &TESForm) -> bool,
275
276 pub IsParentFormTree: fn(this: &TESForm) -> bool,
280
281 pub IsFormTypeChild: fn(this: &TESForm, type_: FormType) -> bool,
285
286 pub Activate: fn(
290 this: &mut TESForm,
291 target_ref: *mut TESObjectREFR,
292 activator_ref: *mut TESObjectREFR,
293 arg3: u8,
294 object: *mut TESBoundObject,
295 target_count: i32,
296 ) -> bool,
297
298 pub SetFormID: fn(this: &mut TESForm, id: FormID, update_file: bool),
301
302 pub GetObjectTypeName: fn(this: &TESForm) -> *const c_char,
306
307 pub QAvailableInGame: fn(this: &TESForm) -> bool,
311}
312const _: () = {
313 const VFUNC_COUNT: usize = 0x3A + 1;
314
315 const EXPECTED_SIZE: usize = VFUNC_COUNT * core::mem::size_of::<usize>();
316 const ACTUAL_SIZE: usize = core::mem::size_of::<TESFormVtbl>();
317 assert!(ACTUAL_SIZE == EXPECTED_SIZE);
318};